//
//
//
//
//
//
//
//
import abstractButton from '../internal/abstractButton'
import icon from '../icon'
import {isNotNull} from '../utils'
export default {
name: 'mu-bottom-nav-item',
props: {
icon: {
type: String,
default: ''
},
title: {
type: String,
default: ''
},
href: {
type: String
},
value: {}
},
data () {
return {
bottomNav: null
}
},
created () {
this.isBottomNavItem = true
},
computed: {
active () {
return this.bottomNav && isNotNull(this.value) && this.bottomNav.value === this.value
},
shift () {
return this.bottomNav && this.bottomNav.shift
}
},
methods: {
handleClick () {
if (this.bottomNav && this.bottomNav.handleItemClick) this.bottomNav.handleItemClick(this.value)
}
},
mounted () {
let children = this.$parent.$children
for (let i = 0; i < children.length; i++) {
if (children[i].$el === this.$el) {
this.index = i
break
}
}
},
components: {
'abstract-button': abstractButton,
icon
}
}
|